package com.studyv3.test.domain;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * lb_采购批次
 * @TableName lb_batch
 */
@TableName(value ="lb_batch")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelIgnoreUnannotated
public class Batch implements Serializable {
    /**
     * 批次id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 批次号（xxxx年第x批）
     */
    @ExcelProperty("批次号")
    private String name;

    /**
     * 是否开放申请 0 关闭 1 开放
     */
    private Integer io;

    /**
     * 开始时间
     */
    @ExcelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束时间
     */
    @ExcelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 预算
     */
    @ExcelProperty("预算")
    private BigDecimal budget;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 终止
     */
    @TableField(exist = false)
    private Integer state;

    /**
     * 恢复
     */
    @TableField(exist = false)
    private Integer rstate;


    /**
     * 余额
     */
    @TableField(exist = false)
    private BigDecimal balance;

    /**
     * 是否有申请，1为有
     */
    @TableField(exist = false)
    private Integer checkFlag;
    /*
    * 已入库条数与待入库条数
    * */
    @TableField(exist = false)
    private Integer warehoused;
    @TableField(exist = false)
    private Integer unwarehoused;

}